﻿using FlickrXplorer.Web.Objects;

namespace FlickrXplorer.Web.Plugin
{
  /// <summary>
  /// The event arguments that are supplied when the <see cref="FlickrXplorer.Web.Plugin.FlickrXplorerPlugin.LoadMainPhoto" text="LoadMainPhoto" />
  /// event is fired on the <see cref="FlickrXplorer.Web.Plugin.FlickrXplorerPlugin" text="FlickrXplorerPlugin" />.
  /// </summary>
  /// <value>
  /// This event holds information about the primary photograph
  /// displayed in FlickrXplorer.
  /// </value>                                                                                                                                     
  public class LoadMainPhotoEventArgs : PluginEventArgs
  {
    /// <summary>
    /// Gets a <see cref="FlickrXplorer.Web.Objects.PhotoDetail" text="PhotoDetail" />
    /// object that holds information about the main photograph.
    /// </summary>                                                                    
    public PhotoDetail PhotoDetail { get; private set; }
    /// <summary>
    /// Gets or sets the content to be displayed above the main
    /// photo.
    /// </summary>
    /// Note
    /// This property will not return the rendered content as
    /// combined with the <see cref="FlickrXplorer.Web.Plugin.ContentSection.Template" text="Template" />.
    public override string Content
    {
      get { return this.contentSection.Content; }
      set { this.contentSection.Content = value; }
    }

    /// <summary>
    /// Creates a new instance of the <see cref="FlickrXplorer.Web.Plugin.LoadMainPhotoEventArgs" text="LoadMainPhotoEventArgs Class" />
    /// </summary>
    /// <param name="contentManager">A reference to the
    ///                              ContentManager.</param>
    /// <param name="photoDetail">Information about the main
    ///                           photograph.</param>                                                                                   
    internal LoadMainPhotoEventArgs(ContentSection contentSection, PhotoDetail photoDetail)
      : base(contentSection)
    {
      this.PhotoDetail = photoDetail;
    }
  }
}
